package de.ventu.model
{
	import com.memamsa.airdb.DB;
	import com.memamsa.airdb.Migrator;
	import com.memamsa.airdb.Modeler;

	[Association(name="tags", className="de.ventu.model.Tag", type="has_many")]
	
	dynamic public class Image extends Modeler
	{
    	private static const migrations:Migrator = new Migrator(
	      Image,
	      {id: true},
	      [
	        function(my:Migrator):void {
	          my.createTable(function():void {
//	          	my.column('image_id', DB.Field.Serial);
	            my.column('imageUrl', DB.Field.Text);
	            my.column('tagRatingName', DB.Field.VarChar, {limit: 128});
	            my.column('imageRatingValue', DB.Field.Integer);
	            my.columnTimestamps();
	          });
	        },
	        function(my:Migrator):void {
					my.joinTable(Tag);
				}
	      ]);
	}
}